package _interface.Exer3;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class Car extends Vehicle implements IPower {
    private String carNumber;

    public Car(String brand, String color, String carNumber) {
        this.setBrand(brand);
        this.setColor(color);
        this.carNumber = carNumber;
    }

    @Override
    public void power() {
        System.out.println("加油");
    }

    @Override
    public void run() {
        super.run();
        power();
        System.out.println("Car...running...");
    }
}
